package com.ruoyi.common.enums;


import java.text.SimpleDateFormat;

/**
 * 常用状态
 *
 * @author lu
 * @since 2019-05-30 16:36
 */
public enum DateFormatEnum {

	SHORT("yy-MM-dd"), DATE("yyyy-MM-dd"), DATE_STR("MM-dd"), SIMPLE("yyyyMMdd"), FULL(
			"yyyy-MM-dd HH:mm:ss"), SECOND("HH:mm:ss"), YMDHM("yyyyMMddHHmm"), MINITUE(
			"yyyyMMdd HHmm"), FULL_SECOND("yyyyMMddHHmmss"), YEAR_MONTH(
			"yyyyMM"), MONTH("yyyy-MM"), YEAR("yyyy"), FULL_TIME("yyyy年MM月dd日HH点mm分ss秒");

	private String sFormat;
	private ThreadLocal<SimpleDateFormat> convert;

	DateFormatEnum(final String format) {
		this.sFormat = format;
		convert = new ThreadLocal<SimpleDateFormat>() {
			@Override
			protected SimpleDateFormat initialValue() {
				return new SimpleDateFormat(format);
			}
		};
	}

	public String getFormat() {
		return sFormat;
	}

	public ThreadLocal<SimpleDateFormat> getConvert() {
		return convert;
	}
}
